package vista;

import data.Conexion;
import java.awt.HeadlessException;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
import javax.swing.JOptionPane;

public class NewTest {

    public static void main(String[] args) {
        Connection con = Conexion.getConexion("PostgreSQL");
        if (con != null) {
            try {
                String str = "insert into Author values(3,'Dios ayúdame :)')";
                Statement st = con.createStatement();
                int val = st.executeUpdate(str);

                if (val > 0) {
                    JOptionPane.showMessageDialog(null, "Inserción correcta :)");
                }
            } catch (SQLException | HeadlessException e) {
                System.out.println("Error: " + e.getMessage());
            }
        }
    }
}